#pragma once
#include <DirectXMath.h>
using namespace DirectX;
class Camera
{
public:
	Camera();
	~Camera();
	void SetLens(float fovY, float aspect, float nearz, float farz);
	void LookAtXM(XMVECTOR pos, XMVECTOR lookAt, XMVECTOR worldUp);
	
	void Walk(float dist);
	void Strafe(float dist);
	void Fly(float dist);

	void Pitch(float angle);
	void Yaw(float angle);

	void UpdateViewMatrix();

	XMMATRIX GetView() const { return XMLoadFloat4x4(&m_View); }
	XMMATRIX GetProj() const { return XMLoadFloat4x4(&m_Proj); }
	XMMATRIX GetViewProj() const { return XMLoadFloat4x4(&m_View) * XMLoadFloat4x4(&m_Proj); }
private:

	enum CameraType
	{
		LANDOBJECT,
		AIRCRAFT,
	};
	XMFLOAT3 m_Pos;
	XMFLOAT3 m_Right;
	XMFLOAT3 m_Up;
	XMFLOAT3 m_Look;

	float m_aspect;
	float m_fovY;
	float m_nearZ;
	float m_farZ;

	XMFLOAT4X4 m_View;
	XMFLOAT4X4 m_Proj;

	CameraType Type;
};

